import 'package:flutter/material.dart';
import 'package:icooker/configs/mock_datas.dart';
import 'package:icooker/model/reommend_data.dart';
// import 'package:fijkplayer/fijkplayer.dart';

/// 基于: fijkplayer
/// https://github.com/befovy/fijkplayer
class FIJKPlayerView extends StatefulWidget {
  VideoInfoData videoInfo;

  FIJKPlayerView(this.videoInfo, {Key? key}) : super(key: key);

  @override
  _FIJKPlayerViewState createState() => _FIJKPlayerViewState();
}

class _FIJKPlayerViewState extends State<FIJKPlayerView> {
  // final FijkPlayer _fijkPlayer = FijkPlayer();
  // late Future<void> _initPlayerFuture;

  @override
  void initState() {
    super.initState();
    // _initPlayerFuture = _fijkPlayer
    //     .setDataSource(widget.videoInfo.video!.vendorVideo!, autoPlay: true);
  }

  @override
  void dispose() {
    super.dispose();
    // _fijkPlayer.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(),
    );
  }

// FutureBuilder<Object> buildFutureBuilder() {
//   return FutureBuilder(
//     future: _initPlayerFuture,
//     builder: (context, snapshot) {
//       if (snapshot.connectionState == ConnectionState.done) {
//         return Container(
//           alignment: Alignment.center,
//           child: FijkView(
//             player: _fijkPlayer,
//           ),
//         );
//       } else {
//         return Center(
//           child: CircularProgressIndicator(),
//         );
//       }
//     },
//   );
// }
}
